<template>
  <div class="detail-wrap">
    <el-dialog v-model="dialogVisible" :title="title" width="800px" class="one-dialog" draggable @close="emit('close')">
      <el-form ref="ruleFormRef" :model="ruleForm">
        <el-row>
          <el-col :span='8'>
            <el-form-item label="拉取单号：">{{props.currentRow.code}}</el-form-item>
          </el-col>
          <el-col :span='8'>
            <el-form-item label="申请人：">{{props.currentRow.applyUser}}</el-form-item>
          </el-col>
          <el-col :span='8'>
            <el-form-item label="申请时间：">{{props.currentRow.time}}</el-form-item>
          </el-col>
        </el-row>
      </el-form>
      <el-form label-position="top">
        <el-form-item label="能力列表">
          <el-table :data="tableData" size="small">
            <el-table-column type="index" label="序号" align="center" width="80" />
            <el-table-column label="能力编码" prop="code" />
            <el-table-column label="能力名称" prop="name" />
            <el-table-column label="能力属地" prop="orgName" />
            <el-table-column label="能力版本号" prop="version" />
            <el-table-column label="操作" width="100">
              <template #default="scope">
                <el-button link type="primary" size="small">删除</el-button>
              </template>
            </el-table-column>
          </el-table>
        </el-form-item>
        <el-button style="margin-top: 20px">添加能力</el-button>
        <el-form-item label="申请原因" style="margin-top: 20px">
          <el-input type="textarea"></el-input>
        </el-form-item>
        <el-form-item label="申请用途">
          <el-input type="textarea"></el-input>
        </el-form-item>
        <el-form-item label="申请人"> xxx </el-form-item>
        <el-form-item label="申请时间"> 2021 </el-form-item>
      </el-form>
    </el-dialog>
  </div>
</template>
<script lang="ts" setup>
import to from 'await-to-js'
import type { FormInstance } from 'element-plus'

const emit = defineEmits(['close'])
const props = defineProps<{
  currentRow: any
  type: string
}>()
const title = ref('拉取配置')
const dialogVisible = ref<boolean>(true)
const ruleForm = ref({
  orgName: '重庆',
  code: '012436456499',
  time: '2020-09-01 13:44:21',
  applyUser: '张三',
  status: 0
})
const tableData = ref([
  {
    code: 'S00100200001',
    name: '能力名称',
    orgName: '重庆',
    version: 'API_2.0_java'
  },
  {
    code: 'S00100200001',
    name: '能力名称',
    orgName: '重庆',
    version: 'API_2.0_java'
  },
  {
    code: 'S00100200001',
    name: '能力名称',
    orgName: '重庆',
    version: 'API_2.0_java'
  }
])
</script>
<style lang="scss" scoped>
.detail-wrap {
}
</style>
